//
//  SERegistrationHospitalCell.swift
//  SmartEyeForPatient
//
//  Created by qdsg on 2021/4/2.
//

import UIKit

class SEHospitalListRegistraionCell: UITableViewCell {

    static let className = "SEHospitalListRegistraionCell"
    static let reuseId = className

    @IBOutlet weak var hospitalLogoImgView: UIImageView! {
        didSet {
            hospitalLogoImgView.layer.cornerRadius = 8
            hospitalLogoImgView.layer.masksToBounds = true
        }
    }
    @IBOutlet weak var hospitalNameLabel: UILabel!
    @IBOutlet weak var hospitalGradeLabel: UILabel! {
        didSet {
            hospitalGradeLabel.layer.cornerRadius = 3
            hospitalGradeLabel.layer.borderWidth = 1
            hospitalGradeLabel.layer.borderColor = UIColor.init(hex: "FFB32D").cgColor
            hospitalGradeLabel.layer.masksToBounds = true
        }
    }

    @IBOutlet weak var hospitalDistanceLabel: UILabel!
    @IBOutlet weak var hospitalAddressLabel: UILabel!

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    func updateCell(model: SEHospitalListItem) {
        hospitalLogoImgView.kf.setImage(urlString: model.picUrl)
        hospitalNameLabel.text = model.name
        hospitalAddressLabel.text = model.address
        hospitalDistanceLabel.text = model.distance
        hospitalGradeLabel.text = " \(model.level) "
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
